package com.ysd.lis.controller.eq;


import com.ysd.common.Result;
import com.ysd.lis.controller.pub.BaseController;
import com.ysd.lis.entity.eq.EqRepairPlan;
import com.ysd.lis.request.CommonPageDto;
import com.ysd.lis.request.eq.EqRepairDto;
import com.ysd.lis.service.eq.EqRepairPlanService;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * <p>
 * 设备管理-设备类型 前端控制器
 * </p>
 *
 * @author prs
 * @since 2024-08-16
 */
@RestController
@RequestMapping("/api/eq/eqRepairPlan")
public class EqRepairPlanController extends BaseController {

    @Autowired
    EqRepairPlanService eqRepairPlanService;

    @ApiOperation("分页查询")
    @GetMapping("/findRepairPlanPageList")
    public Result findRepairPlanPageList(CommonPageDto pageParam){
        return eqRepairPlanService.findRepairPlanPageList(pageParam);
    }

    @ApiOperation("添加")
    @PostMapping("/addRepairPlan")
    public Result addRepairPlan(@RequestBody EqRepairPlan eqRepairPlan) {
        return eqRepairPlanService.addRepairPlan(eqRepairPlan);
    }
    @ApiOperation("编辑")
    @PostMapping("/updateRepairPlan")
    public Result updateRepairPlan(@RequestBody EqRepairPlan eqRepairPlan) {
        return eqRepairPlanService.updateRepairPlan(eqRepairPlan);
    }

    @ApiOperation("批量删除")
    @PostMapping("/batchDeleteRepairPlanList")
    public Result batchDeleteRepairPlanList(@RequestBody EqRepairDto dto){
        return  eqRepairPlanService.batchDeleteRepairPlanList(dto);
    }
    @ApiOperation("根据ID查")
    @GetMapping("/findEqRepairPlanById")
    public Result findEqRepairPlanById( EqRepairPlan eqRepairPlan) {
        return eqRepairPlanService.findEqRepairPlanById(eqRepairPlan);
    }
}
